#include<stdio.h>
#include<stdlib.h>
typedef struct node{
    int data;
    struct node* next;
}Lnode,*Linklist;
int main()
{
    Linklist head=NULL;
    Lnode *s=NULL,*r=NULL;
    int x,m;
    scanf("%d",&m);
    while(m--){
        s=(Lnode*)malloc(sizeof(Lnode));
        scanf("%d",&x);
        s->data=x;
        if(head==NULL) head=s;
        else r->next=s;
        r=s;
    }
    if(r!=NULL)
    {
        r->next=head;
        r=head;
    }
    for(;r!=NULL;r=r->next)
        printf("%d ",r->data);
    system ("pause");
    return 0;
}
/*int main()
{
    struct node *head,*r;
    int m;
    scanf("%d",&m);
    head=create(head,m);

}*/